#include"bits/stdc++.h"
using namespace std;
int sw[20],g;
bool number_have_x(int number,int x)
{
	memset(sw,0,sizeof(sw));
	int number_1=number;
	while(number)
	{
		g+=1;
		sw[g]=number%10;
		number/=10;
		if(sw[g]==x)
		{
			return true;
		}
	}
	return false;
}
int main()
{
	int n,x;
	cin>>n>>x;
	if(number_have_x(n,x))
	{
		cout<<"Yes";
	}
	else
	{
		cout<<"No";
	}
}
